import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;

import javax.imageio.ImageIO;
import javax.imageio.ImageReader;


public class Main {
	public static void main(String args []){
		Iterator<ImageReader> readers = ImageIO.getImageReadersByFormatName("JPEG");
		while (readers.hasNext()) {
		    System.out.println("reader: " + readers.next());
		}
		
		
		try {
			BufferedImage bi= ImageIO.read(new File("D:\\temp\\1.jpg"));
			System.out.println(bi.getType());
			String of="jpeg";
			ImageIO.write(bi, of, new File("D:\\temp\\o."+of));
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
